The quality of a rendered image is significantly improved with anti-aliasing. In computer graphics, aliasing is the process by which smooth curves and angled lines appear to be jagged because the resolution of the graphics device or file is not high enough to represent a smooth curve or angled lines. Many conventional anti-aliasing techniques exist to reduce aliasing effects (e.g., jagged lines following boundaries between pixels) in rendering a two-dimensional (2D) image of the three-dimensional (3D) object(s).
Super-sampling and multi-sampling are two common conventional anti-aliasing techniques. Super-sample anti-aliasing (SSAA) involves generating multiple samples within a pixel, where each sample is independently computed for coverage and shading. The shaded samples are stored within a frame buffer and blended for display. While super-sampling produces a very accurate and high-quality image, super-sampling is quite expensive because each pixel within a rendered image requires the computational processing of multiple fully shaded samples, and shading is typically the most expensive operation within the graphics rendering engine.
Typically, a depth value (sometimes also called a Z value) is also associated with each sample in 3D graphics rendering. The depth value specifies the distance from the scene viewpoint of the object being rendered at that sample location. When multiple opaque objects overlap, comparing their depth values allows determining which object's color should be visible at that sample location.
Typically, objects in a 3D scene are represented by drawing triangles that approximate the surfaces of the objects. A depth value is calculated at each vertex of the triangle and is interpolated to find depth values at sample locations covered by the triangle. This depth value indicates the relative distance the sample is from the viewpoint of the scene. The “Z’ relates to a convention that the central axis of the view of the “camera” (or viewer) is in the direction of the camera's Z axis (rather than the absolute Z axis of a scene). Since three points determine a plane, the sample depth values are all positions on a plane. This is sometimes called the Z-plane of the triangle.
Multi-sample anti-aliasing (MSAA) techniques are a less expensive technique that uses one fully shaded color value and a coverage mask, rather than multiple fully shaded samples, to generate the multiple samples stored in the frame buffer that is ultimately blended to produce a pixel within a rendered image. Multi-sampling is commonly used because of the substantial cost-versus-performance benefit that is typically achieved without a significant loss in overall image quality. Although multi-sampling saves shader processing relative to super-sampling, multi-sampling still requires a frame buffer with multiple samples per pixel and the attendant bandwidth, which can limit application performance. These MSAA techniques are designed to store separate depth and color data values for each sample within a pixel when needed.
While effective in compressing color values of the samples of a multi-sample pixel, MSAA (and other similar techniques) do not compress the depth value of the samples of such a pixel. With a multi-sampled pixel, multiple samples may have the same color value, which permits efficient compression, but in general each depth sample has a different depth value. Depth values are difficult to compress effectively both because they differ at each sample within a pixel and because they are stored using 16-bit to 32-bit values, unlike color components which are typically stored using 8-bit values.
The Detailed Description references the accompanying figures. In the figures, the left-most digit(s) of a reference number identifies the figure in which the reference number first appears. The same numbers are used throughout the drawings to reference like features and components.